﻿<Window x:Class="ResourceBlender.Express.WinCompletionSummary"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:rbcore="clr-namespace:ResourceBlender.Core;assembly=ResourceBlender.Core"
    xmlns:loc="clr-namespace:ResourceBlender.Express"
    loc:WindowService.EscapeClosesWindow="True"
    Title="Completion Summary" Loaded="Window_Loaded"
    MinHeight="310" MinWidth="400" Height="450" Width="680"
    WindowStartupLocation="CenterOwner"
    Style="{StaticResource {x:Type Window}}" Icon="/ResourceBlenderExpress;component/Resources/images/resourceblender.ico">
    <Window.Resources>
        <DataTemplate DataType="{x:Type rbcore:ApplicationSummary}">
            <StackPanel>
                <TextBlock FontSize="18" FontWeight="Bold" Text="{Binding DisplayName,StringFormat=Resource Summary for {0}}" />
                <TextBlock Text="{Binding TotalElements,StringFormat={}{0} elements overall}" />
                <TreeView Margin="0,5,0,10" >
                    <TreeViewItem Header="Bundles" ItemsSource="{Binding Bundles}" />
                </TreeView>
            </StackPanel>
        </DataTemplate>
    </Window.Resources>
    <Window.CommandBindings>
        <CommandBinding Command="ApplicationCommands.New" Executed="AddColumn" CanExecute="CanAddColumn" />
        <CommandBinding Command="ApplicationCommands.Help" Executed="ShowHelp"/>
        <CommandBinding Command="NavigationCommands.Refresh" Executed="RefreshSummaries"/>
        <CommandBinding Command="loc:ResourceBlenderCommands.Delete" Executed="DeleteColumn" CanExecute="IsColumnSelected" />
        <CommandBinding Command="loc:ResourceBlenderCommands.Export" Executed="Export"/>
    </Window.CommandBindings>
    <TabControl Margin="6">
        <TabItem Header="Summaries">
            <DockPanel LastChildFill="True">
                <StatusBar DockPanel.Dock="Bottom" Height="24">
                    <StatusBarItem x:Name="lblStatus" Visibility="Collapsed">Loading</StatusBarItem>
                    <StatusBarItem>
                        <ProgressBar x:Name="prgStatus" IsIndeterminate="True" Visibility="Hidden" />
                    </StatusBarItem>
                </StatusBar>
                <StackPanel DockPanel.Dock="Top" Orientation="Horizontal">
                    <loc:ImageButton HorizontalAlignment="Left" MinWidth="70" Command="NavigationCommands.Refresh"
                      Image="pack://application:,,,/Resources/images/refresh_16.png" ImageLocation="Left" Text="Refresh" />
                </StackPanel>
                <CheckBox x:Name="chkCombined" DockPanel.Dock="Top" IsChecked="False" Content="Combine summaries for all applications" Margin="2" />
                <TabControl x:Name="tbcSummaries" DockPanel.Dock="Top">

                </TabControl>
            </DockPanel>
        </TabItem>
        <TabItem Header="Export">
            <DockPanel>
                <StackPanel DockPanel.Dock="Bottom" Orientation="Horizontal">
                    <loc:ImageButton HorizontalAlignment="Left" MinWidth="70" Command="loc:ResourceBlenderCommands.Export" CommandParameter="html"
                                 Image="pack://application:,,,/Resources/images/go_16.png" ImageLocation="Left" Text="Export to HTML" />
                    <loc:ImageButton HorizontalAlignment="Left" MinWidth="70" Command="loc:ResourceBlenderCommands.Export" CommandParameter="csv"
                                 Image="pack://application:,,,/Resources/images/go_16.png" ImageLocation="Left" Text="Export to CSV" />
                </StackPanel>
                <GroupBox DockPanel.Dock="Top" Header="Extra Columns (HTML Only)">
                    <Grid>
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="Auto" />
                            <ColumnDefinition Width="*" />
                            <ColumnDefinition Width="Auto" />
                        </Grid.ColumnDefinitions>
                        <Grid.RowDefinitions>
                            <RowDefinition Height="*" />
                            <RowDefinition Height="Auto" />
                            <RowDefinition Height="Auto" />
                            <RowDefinition Height="Auto" />
                            <RowDefinition Height="2*" />
                            <RowDefinition Height="2*" />
                        </Grid.RowDefinitions>

                        <ListBox x:Name="lstColumns" Grid.Row="0" Grid.Column="0" Grid.RowSpan="4" Grid.ColumnSpan="2" MinHeight="80" DisplayMemberPath="Header" SelectionMode="Single" ScrollViewer.VerticalScrollBarVisibility="Auto"/>
                        <loc:ImageButton Grid.Row="0" Grid.Column="2" Command="ApplicationCommands.New" Text="Add" Image="Resources/images/add_16.png" ShowText="False" ToolTip="Add Bundle" Style="{StaticResource ToolBarButton}" CommandParameter="{Binding SelectedItem,ElementName=lstColumns}" />
                        <!--loc:ImageButton Grid.Row="1" Grid.Column="2" Command="loc:ResourceBlenderCommands.Edit" Text="Edit" Image="Resources/images/edit_16.png" ShowText="False" ToolTip="Edit Bundle" Style="{StaticResource ToolBarButton}" CommandParameter="{Binding SelectedItem,ElementName=lstColumns}" /-->
                        <loc:ImageButton Grid.Row="1" Grid.Column="2" Command="loc:ResourceBlenderCommands.Delete" Text="Delete" Image="Resources/images/delete_16.png" ShowText="False" ToolTip="Delete Bundle" Style="{StaticResource ToolBarButton}" CommandParameter="{Binding SelectedItem,ElementName=lstColumns}" />

                        <Label Grid.Row="4" Grid.Column="0">Column Header</Label>
                        <TextBox Grid.Row="4" Grid.Column="1" Grid.ColumnSpan="2" x:Name="txtHtmlHeader" VerticalScrollBarVisibility="Auto" Text="{Binding SelectedItem.Header,ElementName=lstColumns,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" AcceptsReturn="True" />

                        <Label Grid.Row="5" Grid.Column="0">Column Content</Label>
                        <TextBox Grid.Row="5" Grid.Column="1" Grid.ColumnSpan="2" x:Name="txtHtmlContent" VerticalScrollBarVisibility="Auto" Text="{Binding SelectedItem.Content,ElementName=lstColumns,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" AcceptsReturn="True"/>
                    </Grid>
                </GroupBox>
            </DockPanel>
        </TabItem>
    </TabControl>
</Window>
